# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

default_platform(:android)

platform :android do
  desc "Build android aab and apk"
  lane :build_android do |options|
    sh "./flutter_build.sh --clean"
    sh "./flutter_build.sh --apk"
  end

  desc "Deploy (Upload to play store)"
  lane :deploy_android do |options|
    upload_to_play_store(
      track: options[:production] ? 'production' : options[:internal] ? 'internal' : options[:alpha] ? 'alpha' : 'beta',
      aab: ENV['AAB_PATH'],
      skip_upload_images: true,
      skip_upload_screenshots: true,
    )
  end
end
